/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package data;

import textmining.gpanalysis.AnalyzerUtil;
import java.io.Reader;
import java.io.StringReader;

/**
 *
 * @author ibrahimsabek
 */
public class Post {

    private long pID;  //post id
    private String title;
    private String date;
    private String lang;
    private String[] tags;
    private String category;
    private String body;
    private Reader titleReader; //title Reader
    private Reader catReader; //category Reader
    private Reader[] tagsReaders; //tags Readers
    private Reader[] paraReaders; //paragraph Readers
   

  
    public Post(){}

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
        String[] paragraphs = AnalyzerUtil.getParagraphs(body, 0);
        paraReaders = new StringReader[paragraphs.length];

        //create paragraphs readers
        for(int i=0; i<paragraphs.length; i++){
            paraReaders[i] = new StringReader(paragraphs[i]);
        }
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
        this.catReader = new StringReader(category);
    }

    public String[] getTags() {
        return tags;
    }

    public void setTags(String[] tags) {
        this.tags = tags;
        tagsReaders = new StringReader[tags.length];
        for(int i = 0; i<tags.length; i++){
            tagsReaders[i] = new StringReader(tags[i]);
        }
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Reader[] getParaReaders() {
        return paraReaders;
    }

    public void setParaReaders(Reader[] paraReaders) {
        this.paraReaders = paraReaders;
    }

    public Reader getTitleReader() {
        return titleReader;
    }

    public void setTitleReader(Reader titleReader) {
        this.titleReader = titleReader;
    }

    public Reader[] getTagsReaders() {
        return tagsReaders;
    }

    public void setTagsReaders(Reader[] tagsReaders) {
        this.tagsReaders = tagsReaders;
    }

    public Reader getCatReader() {
        return catReader;
    }

    public void setCatReader(Reader catReader) {
        this.catReader = catReader;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public long getpID() {
        return pID;
    }

    public void setpID(long pID) {
        this.pID = pID;
    }


    
}
